// File IPerson.cpp
//
// Purpose: Contains the definition of the interface IPerson
//
// Author : Bryson King
// Date : 19 March 2013
// --------------------------------------------------------------
#include "IPerson.h"

IPerson::IPerson() : m_oInventory()
{}

IPerson::~IPerson()
{}

bool IPerson::InCombat() const
{
	return m_bInCombat;
}

bool IPerson::PersonAlive() const
{
	if (Health() > 0)
		return true;
	else
		return false;
}

void IPerson::StartCombat()
{
	m_bInCombat = true;
}
	
void IPerson::EndCombat()
{
	m_bInCombat = false;
}

void IPerson::AddItemToInventory(SItem* item)
{
	// Add given item to player inventory
	m_oInventory.AddItem(item);
}

void IPerson::RemoveFromInventory(SItem* itemToRemove)
{
	// Remove item from inventory, but do not delete the item
	m_oInventory.RemoveItem(itemToRemove);
}

SItem* IPerson::RetrieveItemFromInventory(int index)
{
	// Retrieve item from inventory based on index
	return m_oInventory.RetrieveItem(index);
}

SItem** IPerson::RetrieveAllItemsFromInventory(int& count)
{
	// Retrieve the list of items the player is carrying
	return m_oInventory.RetrieveAllItems(count);
}

SItem** IPerson::RetrieveAllWeaponsFromInventory(int& count)
{
	// Retrieve the list of items the player is carrying
	return m_oInventory.RetrieveAllWeapons(count);
}
